document.getElementById('submit-btn').onclick = function() {
    fetch('/api/submit', {
        method: 'POST',
        headers: {'Content-Type': 'application/json'},
        body: JSON.stringify({data: missionContent})
    }).then(response => response.json())
        .then(json => {
            const suggestion = json.suggestion;
            document.getElementById('suggestion-box').value = suggestion;
        }).catch(err => {
            alert('建议生成失败: ' + err.message);
        });
};